package com.dpj.test;

import lombok.extern.slf4j.Slf4j;

@Slf4j(topic = "c.WashCupDemo")
public class WashCupDemo {
    public static void main(String[] args) {
        Thread t1=new Thread(()->{
            log.debug("老王洗水壶");
            try {
                Thread.sleep(10*60);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            log.debug("烧开水");
            try {
                Thread.sleep(10*60*5);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        },"老王");

        Thread t2=new Thread(()->{
            log.debug("洗水壶");
            try {
                Thread.sleep(10*60);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            log.debug("洗水杯");
            try {
                Thread.sleep(10*60*2);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            log.debug("拿茶叶");
            try {
                Thread.sleep(10*60);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            try {
                t1.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            log.debug("泡茶喝了");
        },"小王");

        t1.start();
        t2.start();


    }
}
